#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Desc: count func call


class CallingCounter(object):
    def __init__(self, func):
        self.count = 0
        self.func = func

    def __call__(self, *args, **kwargs):
        self.count += 1
        return self.func(*args, **kwargs)

@CallingCounter
def test():
    # `f'xxx.x' <=> 'xx{}'.format()`
    # print(f'run {test.count} times')
    print('run {} times'.format(test.count))


for i in range(10):
    
    if test.count < 1 :
        # test()
        pass
